<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddTownColumnToOpenShopSiteLocationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_site_locations', function (Blueprint $table) {
            $table->unsignedInteger('townGrade')->after('cityArea')->default(0)->comment('乡镇街道等级');
            $table->string('town', 32)->after('cityArea')->default('')->comment('乡镇街道');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_site_locations', function (Blueprint $table) {
            $table->dropColumn('town');
            $table->dropColumn('townGrade');
        });
    }
}
